extends "../cex___toolman/cex___toolman.gd"
func _info():
	pass

func _connect():
	._connect()

func _extInit():
	._extInit()
	chaName = "小偷"
	camp = "刺客"
	lv = 1
	attCoe.atkRan = 1
	attCoe.atk = 11 / 8.5 * 2
	attCoe.maxHp = 360 / 112.5
	attAdd.spd += 1.33
	atkEff = "atk_dao"
	addSkillTxt("以小博大：每次攻击[不管是否命中]消耗1金币使伤害增加15%[钱不够则取消;特效伤害除外]，10次内杀死敌人奖励20金币[cd:2秒]【杀死敌人后重置计数】")

var pw1 = 1.15
var cnt = 0
var nowcnt = 0
var cdflag = 0
var limitc = 10

func _onBattleStart():
	._onBattleStart()
	nowcnt = 0
	cdflag = 0
	cnt = 0

func _onAtkChara(atkinfo):
	if atkinfo.atkType != Chara.AtkType.EFF:
		if self.team == 1:
			if sys.main.player.gold:
				sys.main.player.plusGold(-1)
				atkinfo.hurtVal *= pw1
				nowcnt += 1
				if nowcnt > 10:
					nowcnt = 1	
		else:
			atkinfo.hurtVal *= pw1 - 0.1
	._onAtkChara(atkinfo)
	
func _onKillChara(atkinfo):
	._onKillChara(atkinfo)
	if nowcnt <= 10 && !cdflag && self.team == 1:
		nowcnt = 0
		cdflag = 1
		sys.main.player.plusGold(20)

func _upS():
	._upS()
	if cdflag:
		cnt += 1
		if cnt == 2:
			cnt = 0
			cdflag = 0
